package com.novoda.runbuddy.controller;

import android.content.Context;
import android.content.Intent;
import android.view.KeyEvent;
import android.widget.ImageButton;

import com.novoda.runbuddy.activity.Home;
import com.novoda.runbuddy.activity.TabsAdapter;
import com.novoda.runbuddy.view.HomeView;

public class HomeControllerImpl implements IHomeController {

	@SuppressWarnings("unused")
	private HomeView	homeView;
	private Home		home;

	public HomeControllerImpl(Context home) {
	}

	public void createHomeView(Home home, ImageButton stopClock, ImageButton diary) {

		this.home = home;
		this.homeView = new HomeView(home, stopClock, diary);

	}

	public boolean onKeyDown(int keyCode, KeyEvent event) {
		boolean consumed = true;
		switch (keyCode) {
			case KeyEvent.KEYCODE_T:
				Intent intent = new Intent(home, TabsAdapter.class);
				home.startActivity(intent);
				break;
			case KeyEvent.KEYCODE_R:
				Intent intent2 = new Intent(home, TabsAdapter.class);
				home.startActivity(intent2);
				break;
			default:
				consumed = false;
				break;
		}

		return consumed;
	}

}
